package cc.yugu.yhdw.common.domain.hdw;

import cc.yugu.yhdw.common.annotation.Transient;
import cc.yugu.yhdw.common.domain.StringIdEntity;
import cc.yugu.yhdw.common.entity.json.DateTimeSerializer;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 包月订单退款
 */
public class ExchangePacketOrderRefund extends StringIdEntity {

    public enum RefundStatus {
        APPLY_REFUND(1,"申请退款"),
        REFUND_SUCCESS(2,"退款成功"),
        REFUND_FAIL(3,"退款失败"),
        REFUSE_REFUND(4, "拒绝退款"),
        ;

        private final int value;
        private final String name;

        RefundStatus(int value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();

        static {
            for (RefundStatus e : RefundStatus.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }
    public String getTypeName() {
        if(type != null) {
            return ExchangePacket.Type.getName(type);
        }
        return "";
    }
    public String getRefundStatusName() {
        if(refundStatus != null) {
            return RefundStatus.getName(refundStatus);
        }
        return "";
    }
    protected Integer agentId; //运营商
    protected Integer agencyId; // add field 代理商id  --zxj
    protected Integer money; //
    protected Integer type; //
    protected Integer customerId; //
    protected String customerMobile; //
    protected String customerFullname; //
    protected Integer refundStatus; //
    protected String refundReason; //
    protected Date applyRefundTime; //
    protected Date refundTime; //
    protected Integer refundMoney; //
    protected String refundPhoto; //
    protected String refundOperator; //
    protected Date createTime; //

    @Transient
    String agentName;
    @Transient
    String agencyName; // add field 代理商名称 --zxj

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getAgentId() {
        return agentId;
    }

    public void setAgentId(Integer agentId) {
        this.agentId = agentId;
    }

    public String getAgentName() {
        return agentName;
    }

    public void setAgentName(String agentName) {
        this.agentName = agentName;
    }

    public Integer getMoney() {
        return money;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public String getCustomerMobile() {
        return customerMobile;
    }

    public void setCustomerMobile(String customerMobile) {
        this.customerMobile = customerMobile;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public String getCustomerFullname() {
        return customerFullname;
    }

    public void setCustomerFullname(String customerFullname) {
        this.customerFullname = customerFullname;
    }

    public Integer getRefundStatus() {
        return refundStatus;
    }

    public void setRefundStatus(Integer refundStatus) {
        this.refundStatus = refundStatus;
    }

    public String getRefundReason() {
        return refundReason;
    }

    public void setRefundReason(String refundReason) {
        this.refundReason = refundReason;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getApplyRefundTime() {
        return applyRefundTime;
    }

    public void setApplyRefundTime(Date applyRefundTime) {
        this.applyRefundTime = applyRefundTime;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getRefundTime() {
        return refundTime;
    }

    public void setRefundTime(Date refundTime) {
        this.refundTime = refundTime;
    }

    public Integer getRefundMoney() {
        return refundMoney;
    }

    public void setRefundMoney(Integer refundMoney) {
        this.refundMoney = refundMoney;
    }

    public String getRefundPhoto() {
        return refundPhoto;
    }

    public void setRefundPhoto(String refundPhoto) {
        this.refundPhoto = refundPhoto;
    }

    public String getRefundOperator() {
        return refundOperator;
    }

    public void setRefundOperator(String refundOperator) {
        this.refundOperator = refundOperator;
    }

    @JsonSerialize(using = DateTimeSerializer.class)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getAgencyId() {
        return agencyId;
    }

    public void setAgencyId(Integer agencyId) {
        this.agencyId = agencyId;
    }

    public String getAgencyName() {
        return agencyName;
    }

    public void setAgencyName(String agencyName) {
        this.agencyName = agencyName;
    }
}
